package de.unikoblenz.west.csxpoi.server.connector;

import java.net.HttpURLConnection;
import java.net.URL;
import java.util.List;

import de.unikoblenz.west.csxpoi.server.CategoryWrapper;
import de.unikoblenz.west.csxpoi.server.Constants;
import de.unikoblenz.west.csxpoi.server.PoiWrapper;

/**
 * Connector to a datastore
 * 
 * @author Yassin Nachite
 *
 */
public abstract class SourceConnector {
	String serverAdress = Constants.SERVER_ADDRESS;
	String repositoryID = Constants.REPOSITORY_ID;
	URL url = null;
	HttpURLConnection conn = null;
	
	protected SourceConnector(){}
	
	
	
	public synchronized String getServerAdress() {
		return serverAdress;
	}



	public synchronized void setServerAdress(String serverAdress) {
		this.serverAdress = serverAdress;
	}



	public synchronized String getRepositoryID() {
		return repositoryID;
	}



	public synchronized void setRepositoryID(String repositoryID) {
		this.repositoryID = repositoryID;
	}



	public abstract void initialize();
	
	public abstract List<String> formatResult(List<String> data);
	
	public abstract List<String> formatResult(String data);
	
	public abstract List<String> baseRequest(String[] args);	

	public abstract List<String> contributionRequest(String[] args);
	
	public abstract List<PoiWrapper> poiRequest(String[] args);
	
	public abstract List<String> userRequest(String[] args);
	
	public abstract List<String> vocabularyRequest(String[] args);

	public abstract List<CategoryWrapper> categoryRequest(String[] args);
}
